<template>
	<section class="main_" v-loading="loading">

	</section>
</template>

<script>
	export default {
		data() {
			return {
        loading : false ,
        tableData : [],
        search : {} ,
        page : { skip : 0 ,limit : 10 ,count : 0},
        shopDialog : { isShow : false, banner : '' }
			}
		},
		methods: {
      openBanner : function (res) {//查看大图
        this.shopDialog.banner = res ;
        this.shopDialog.isShow = true ;
      },
      delShop : function (res) {//调用删除门店接口
        this.$confirm('此操作会将商店从系统中移除, 是否继续?', '提示', {
          	confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'
				}).then(() => {
					this.loading = true ;
					this.$http.post('/api/admin/delShopById',{_id : res }).then(res => {
						this.loading = false ;
						let result = res.data ;
						if(result.code == 100){
							this.$message({
								type: 'success',
								message: '删除成功!'
							});
						}
						this.initList();
					})
				});
      },
      handleCurrentChange: function(res) {
					if (res == 1)
							this.page.skip = 0;
					else
							this.page.skip = (res - 1) * this.page.limit
					this.initList();
			},
			handleSizeChange: function(res) {
					this.page.limit = res;
					this.initList();
			},
      initList : function () {
        this.loading = true ;
        this.$http.post("/api/admin/queryShopList",{search :this.search  , page : this.page}).then( res => {
          this.loading = false ;
          let result = res.data ;
          if(result.code == 100 ){
            this.tableData = result.data ;
            this.page.count = result.count ;
          }
        })
      }
		},
		created() {
      // this.initList();
		}
		
	}

</script>

<style scoped lang="scss">
</style>